<template>
  <div class="resume-page">
    <div class="top-decoration"></div>
    <div class="resume-card" @mouseenter="cardHover=true" @mouseleave="cardHover=false">
      <!-- 头部信息 -->
      <header class="resume-header">
        <div class="profile-container">
          <div class="avatar-wrapper">
            <div class="avatar" :style="{ backgroundImage: `url(${avatarUrl})` }"></div>
          </div>
          <div class="personal-info">
            <h1 class="name" :class="{ 'name-animate': cardHover }">{{ basicInfo.name }}</h1>
            <h2 class="job-title">{{ basicInfo.jobTitle }}</h2>
            <p class="tagline">{{ basicInfo.tagline }}</p>
            <div class="contact-list">
              <div v-for="(item, i) in basicInfo.contact" :key="i" class="contact-item">
                <span class="icon">{{ item.icon }}</span>
                <span>{{ item.content }}</span>
              </div>
            </div>
          </div>
        </div>
      </header>

      <!-- 内容区 -->
      <div class="content-divider"></div>
      <div class="resume-content">
        <!-- 左侧边栏 -->
        <aside class="sidebar">
          <!-- 关于我 -->
          <section class="section">
            <h3 class="section-title">👤 关于我</h3>
            <p class="about-text">{{ aboutInfo.content }}</p>
            <div class="strengths">
              <h4>核心优势</h4>
              <ul>
                <li v-for="(s, i) in aboutInfo.strengths" :key="i">• {{ s }}</li>
              </ul>
            </div>
          </section>

          <!-- 技能 -->
          <section class="section">
            <h3 class="section-title">🛠️ 专业技能</h3>
            <div v-for="(cat, i) in skillsInfo.categories" :key="i">
              <h4>{{ cat.name }}</h4>
              <div v-for="(skill, j) in cat.skills" :key="j" class="skill-item">
                <div class="skill-header">
                  <span>{{ skill.name }}</span>
                  <span>{{ skill.level }}%</span>
                </div>
                <div class="skill-bar">
                  <div class="progress" :style="{ width: skill.level + '%', background: skill.color }"></div>
                </div>
              </div>
            </div>
          </section>
        </aside>

        <!-- 右侧主内容 -->
        <main class="main-content">
          <!-- 工作经历 -->
          <section class="section">
            <h3 class="section-title">💼 工作经历</h3>
            <div v-for="(exp, i) in experienceInfo" :key="i" class="exp-item">
              <div class="timeline"></div>
              <div class="exp-content">
                <div class="exp-header">
                  <h4>{{ exp.position }}</h4>
                  <span>{{ exp.period }}</span>
                </div>
                <p class="company">🏢 {{ exp.company }}</p>
                <ul class="responsibilities">
                  <li v-for="(r, j) in exp.responsibilities" :key="j">✓ {{ r }}</li>
                </ul>
              </div>
            </div>
          </section>

          <!-- 项目经验 -->
          <section class="section">
            <h3 class="section-title">📁 项目经验</h3>
            <div v-for="(proj, i) in projectsInfo" :key="i" class="proj-item">
              <div class="proj-header">
                <h4>{{ proj.name }}</h4>
                <span>{{ proj.period }}</span>
              </div>
              <p>角色：{{ proj.role }}</p>
              <p class="overview">{{ proj.overview }}</p>
            </div>
          </section>
        </main>
      </div>

      <!-- 底部 -->
      <footer class="footer">
        <button @click="handlePrint">🖨️ 打印简历</button>
        <p>最后更新：{{ lastUpdateTime }}</p>
      </footer>
    </div>
    <div class="bottom-decoration"></div>
  </div>
</template>

<script>
	
export default {
  data() {
    return {
      cardHover: false,
      // 美女头像图片链接（公开资源）
      avatarUrl: "https://picsum.photos/id/64/200/200",
      lastUpdateTime: "2024年10月",
      
      basicInfo: {
        name: "杨同成",
        jobTitle: "资深UI/UX设计师",
        tagline: "8年设计经验，专注用户体验与界面设计，擅长Figma与交互逻辑",
        contact: [
          { icon: "✉️", content: "zhangyutong@example.com" },
          { icon: "📞", content: "139-0000-6789" },
          { icon: "🔗", content: "dribbble.com/zhangyutong" }
        ]
      },
      
      aboutInfo: {
        content: "8年UI/UX设计经验，曾任职于知名互联网公司，主导过多个千万级用户产品的设计工作，擅长从用户需求出发打造优质体验。",
        strengths: ["用户体验设计", "交互逻辑梳理", "Figma组件库搭建", "跨团队协作"]
      },
      
      skillsInfo: {
        categories: [{
          name: "专业技能",
          skills: [
            { name: "UI设计", level: 95, color: "#e91e63" },
            { name: "UX研究", level: 90, color: "#9c27b0" },
            { name: "Figma", level: 98, color: "#00acc1" },
            { name: "动效设计", level: 85, color: "#ff9800" }
          ]
        }]
      },
      
      experienceInfo: [{
        position: "资深UI/UX设计师",
        company: "星辰设计工作室",
        period: "2020.05 - 至今",
        responsibilities: [
          "负责企业级SaaS产品的整体设计系统搭建",
          "主导用户研究与可用性测试，提升产品转化率30%",
          "培养5人设计团队，建立标准化设计流程"
        ]
      }],
      
      projectsInfo: [{
        name: "智能办公协作平台",
        period: "2021.03 - 2022.08",
        role: "设计负责人",
        overview: "为500人以上企业打造的协作平台，涵盖项目管理、文档协作、视频会议等功能，设计方案获得年度最佳用户体验奖。"
      }]
    };
  },
  methods: {
    handlePrint() {
      window.print();
    }
  }
};
</script>

<style scoped>
.resume-page {
  padding: 2rem 0;
  background: #f5f7fa;
}
.top-decoration, .bottom-decoration {
  height: 8px;
  background: linear-gradient(90deg, #e91e63, #9c27b0);
}
.resume-card {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  overflow: hidden;
}
.resume-header {
  padding: 2rem;
  background: #fafbfc;
  border-bottom: 1px solid #f0f2f5;
}
.profile-container {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 5px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.name {
  font-size: 2rem;
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
}
.name-animate {
  color: #e91e63;
}
.job-title {
  color: #e91e63;
  margin: 0 0 1rem 0;
}
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.content-divider {
  height: 3px;
  background: linear-gradient(90deg, #e91e63, #9c27b0);
}
.resume-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  padding: 2rem;
}
.section-title {
  background: #e91e63;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  margin: 0 0 1rem 0;
  font-size: 1rem;
}
.section {
  margin-bottom: 2rem;
}
.skill-bar {
  height: 8px;
  background: #f0f2f5;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.progress {
  height: 100%;
  transition: width 1s ease;
}
.exp-item {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.timeline {
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e91e63;
}
.exp-content {
  background: #fafbfc;
  padding: 1rem;
  border-radius: 6px;
}
.footer {
  padding: 1rem 2rem;
  background: #fafbfc;
  border-top: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
}
button {
  background: #e91e63;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}
@media (max-width: 768px) {
  .resume-content {
    grid-template-columns: 1fr;
  }
  .profile-container {
    flex-direction: column;
    text-align: center;
  }
}
</style>